<style lang="scss">
@import "uview-ui/index.scss";
</style>
<script>
import { isWeixin, wxShareConfig } from "util/wx.js";
export default {
  onLaunch(Obj) {
    if (Obj.query.longitude && Obj.query.latitude) {
      uni.setStorageSync("wx_location", {
        longitude: Obj.query.longitude,
        latitude: Obj.query.latitude
      });
    }
    console.log("App Launch");
  },
  onShow: function() {
    console.log("App Show");
  },
  onHide: function() {
    console.log("App Hide");
  },
  mounted() {
    if (isWeixin() && window.location.href.indexOf("policyDetails") == -1) {
      // uni.webView.getEnv((res)=>{
      //  if(!res.miniprogram){
      this.initShareConfig();
      //  }
      // })
    }
  },
  methods: {
    initShareConfig() {
      let _this = this;
      let windowurl = window.location.href.split("#")[0];
      uni.request({
        url: "https://oldm.51bmj.cn/WeiXin/GetClientSign", //仅为示例，并非真实接口地址。
        data: {
          rawUrl: windowurl
        },
        dataType: "json",
        header: {
          "X-Requested-With": "XMLHttpRequest"
        },
        method: "GET",
        success: res => {
          if (res.statusCode == 200) {
            let { data } = res;
            let shareInfo = {
              title: "比目镜",
              desc: "政策尽知 红利尽享",
              link: window.location.href
            };
            wxShareConfig(this.$wx, data, shareInfo);
          }
        }
      });
    }
  }
};
</script>

<style lang="less">
page {
  min-height: 100%;
  height: 100%;
  background: #f8f9fd;
}
@import "vant/lib/index.css";
/*每个页面公共css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background-color: #f8f9fd;
}
.navigator {
  -webkit-tap-highlight-color: transparent; /*解决手机版点击背景问题*/
}
ul li {
  list-style: none;
  -webkit-tap-highlight-color: transparent; /*解决手机版点击背景问题*/
}
a {
  text-decoration: none;
  background-color: transparent;
}
a,
a:hover,
a:visited,
a:link,
a:active,
a:focus {
  text-decoration: none;
  -webkit-tap-highlight-color: transparent; /*解决手机版点击背景问题*/
}
/* 显示一行，省略号 */
.multipleRow {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

table {
  border-right: 1rpx solid #ccc;
  border-bottom: 1rpx solid #ccc;
  display: flex;
  flex-direction: column;
  //   cellpadding: 10;
  tbody {
    tr {
      td {
        border-left: 1rpx solid #ccc;
        border-top: 1rpx solid #ccc;
        span {
          font-size: 20rpx;
        }
      }
    }
  }
}
</style>
